<template>
  <div>
    <el-button type="primary" @click="willAdd">添加</el-button>
    <list-vue @willEdit="willEdit"></list-vue>
    <form-vue :info="info" ref="form"></form-vue>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import listVue from "./components/list.vue";
import formVue from "./components/form.vue";
import { toggle } from "../../mixins/mixins";
export default {
  components: {
    listVue,
    formVue,
  },
  props: [],
  mixins: [toggle],
  data() {
    return {};
  },
  computed: {
    ...mapGetters({
      list: "seckill/list",
    }),
  },
  mounted() {
    this.reqList();
  },
  methods: {
    ...mapActions({
      reqList: "seckill/reqList",
    }),

    willEdit(id) {
      this.info.isshow = true;
      this.info.isAdd = false;
      this.$refs.form.getOne(id);
    },
  },
};
</script>
<style scoped lang="less">
@import "../../less/index.less";
</style>